<?php
/**
 * Magento Enterprise Edition
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Magento Enterprise Edition End User License Agreement
 * that is bundled with this package in the file LICENSE_EE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.magento.com/license/enterprise-edition
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magento.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magento.com for more information.
 *
 * @category    Mage
 * @package     Mage_Customer
 * @copyright Copyright (c) 2006-2015 X.commerce, Inc. (http://www.magento.com)
 * @license http://www.magento.com/license/enterprise-edition
 */

/**
 * API2 class for customer (admin)
 *
 * @category   Mage
 * @package    Mage_Customer
 * @author     Magento Core Team <core@magentocommerce.com>
 */
class ApiCenter_VendorsApi_Model_Api2_Announcement_Rest_Admin_V1 extends ApiCenter_VendorsApi_Model_Api2_Announcement_Rest{
   
    

    /**
     * Retrieve information about specified order item
     *
     * @throws Mage_Api2_Exception
     * @return array
     */
    protected function _retrieve()
    {
        $aid = $this->getRequest()->getParam("id");
        try {
            $collection = $this->_getForRetrieve($aid);
            $ordersData = $collection -> getData();
        
            $res['status']=1;
            $res['info']=$ordersData;
        
        } catch (Exception $e) {
            $res['status']=0;
            $res['info']=$e->getMessage();
        }
        return $res;
    }
    /**
     * TODO
     *
     * @return int
     */
    protected function _retrieveCollection() {
      
        try {
        $theme =    $this->getRequest()->getParam("theme",false);
        if($theme){
            $theme = true;
        }else{
            $theme = false;
        }
        $collection = $this->_getCollectionForRetrieve($theme);
        $ordersData = $collection -> getData();
     
        if(!$theme){
            $res['info']['total'] = $collection->getSize();
        }
        $res['status']=1;
        $res['info']['data']=$ordersData;
        } catch (Exception $e) {
            $res['status']=0;
            $res['info']=$e->getMessage();
        }
        return $res;  
    }
    
    
    
    
    

}
